package model;

/**
 * Vertegenwoordigt een GPS Latitude
 */
public class GpsLatitude {
    
    private int degrees;
    private int minutes;
    private double seconds;
    
    public GpsLatitude(int degrees, int minutes, double seconds) {
        this.degrees = degrees;
        this.minutes = minutes;
        this.seconds = seconds;
    }
    
    public double getDecimal() {
        double result = degrees;
        
        double totalSeconds = seconds;
        totalSeconds = totalSeconds + (minutes * 60);
        
        double degreeFraction = totalSeconds / 3600;
        result = result + degreeFraction;
        
        return result;
    }
}
